package com.own.business.level.entity.map;

import com.own.business.level.entity.po.LevelUserHistory;
import com.own.component.common.base.entity.BaseMap;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.time.LocalDate;

/**
 * LevelUserHistoryMapVo
 *
 * @author chenxueli
 * @date 2022-07-25 10:13:00
 */
@ApiModel("用户经验获取流水" + ConstantBeanSuffix.MAP_VO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class LevelUserHistoryMapVo extends BaseMap<LevelUserHistory> {

    @ApiModelProperty("用户id")
    private Long userId;

    @ApiModelProperty("操作前经验")
    private Integer beforeExp;

    @ApiModelProperty("操作后经验")
    private Integer afterExp;

    @ApiModelProperty("获得的经验")
    private Integer exp;

    @ApiModelProperty("经验信息描述")
    private String content;

    @ApiModelProperty("经验类型")
    private String type;

    @ApiModelProperty("操作的日期")
    private LocalDate operateDate;

    @ApiModelProperty("连续次数")
    private Integer consecutive;

    /**
     * 构造方法
     *
     * @param entity 原对象
     */
    public LevelUserHistoryMapVo(@NonNull LevelUserHistory entity) {
        super(entity);
        this.userId = entity.getFkUserId();
        this.beforeExp = entity.getBeforeExp();
        this.afterExp = entity.getAfterExp();
        this.exp = entity.getExp();
        this.content = entity.getContent();
        this.type = entity.getType();
        this.operateDate = entity.getOperateDate();
        this.consecutive = entity.getConsecutive();
    }

}
